<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html xmlns="http://www.w3.org/1999/xhtml"><head><link rel="stylesheet" type="text/css" href="style.css" /><script type="text/javascript" src="highlight.js"></script></head><body><pre><span class="hs-comment">-- | Unit identifier pretty-printing</span><span>
</span><span id="line-2"></span><span class="hs-keyword">module</span><span> </span><span class="hs-identifier">GHC.Unit.Ppr</span><span>
</span><span id="line-3"></span><span>   </span><span class="hs-special">(</span><span> </span><span class="annot"><a href="GHC.Unit.Ppr.html#UnitPprInfo"><span class="hs-identifier">UnitPprInfo</span></a></span><span> </span><span class="hs-special">(</span><span class="hs-glyph">..</span><span class="hs-special">)</span><span>
</span><span id="line-4"></span><span>   </span><span class="hs-special">)</span><span>
</span><span id="line-5"></span><span class="hs-keyword">where</span><span>
</span><span id="line-6"></span><span>
</span><span id="line-7"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.Prelude.html"><span class="hs-identifier">GHC.Prelude</span></a></span><span>
</span><span id="line-8"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.Utils.Outputable.html"><span class="hs-identifier">GHC.Utils.Outputable</span></a></span><span>
</span><span id="line-9"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="../../base/src/Data.Version.html#"><span class="hs-identifier">Data.Version</span></a></span><span>
</span><span id="line-10"></span><span>
</span><span id="line-11"></span><span class="hs-comment">-- | Subset of UnitInfo: just enough to pretty-print a unit-id</span><span>
</span><span id="line-12"></span><span class="hs-comment">--</span><span>
</span><span id="line-13"></span><span class="hs-comment">-- Instead of printing the unit-id which may contain a hash, we print:</span><span>
</span><span id="line-14"></span><span class="hs-comment">--    package-version:componentname</span><span>
</span><span id="line-15"></span><span class="hs-comment">--</span><span>
</span><span id="line-16"></span><span class="hs-keyword">data</span><span> </span><span id="UnitPprInfo"><span class="annot"><a href="GHC.Unit.Ppr.html#UnitPprInfo"><span class="hs-identifier hs-var">UnitPprInfo</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span id="UnitPprInfo"><span class="annot"><a href="GHC.Unit.Ppr.html#UnitPprInfo"><span class="hs-identifier hs-var">UnitPprInfo</span></a></span></span><span>
</span><span id="line-17"></span><span>   </span><span class="hs-special">{</span><span> </span><span id="unitPprPackageName"><span class="annot"><span class="annottext">UnitPprInfo -&gt; String
</span><a href="GHC.Unit.Ppr.html#unitPprPackageName"><span class="hs-identifier hs-var hs-var">unitPprPackageName</span></a></span></span><span>    </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="../../base/src/GHC.Base.html#String"><span class="hs-identifier hs-type">String</span></a></span><span>       </span><span class="hs-comment">-- ^ Source package name</span><span>
</span><span id="line-18"></span><span>   </span><span class="hs-special">,</span><span> </span><span id="unitPprPackageVersion"><span class="annot"><span class="annottext">UnitPprInfo -&gt; Version
</span><a href="GHC.Unit.Ppr.html#unitPprPackageVersion"><span class="hs-identifier hs-var hs-var">unitPprPackageVersion</span></a></span></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="../../base/src/Data.Version.html#Version"><span class="hs-identifier hs-type">Version</span></a></span><span>      </span><span class="hs-comment">-- ^ Source package version</span><span>
</span><span id="line-19"></span><span>   </span><span class="hs-special">,</span><span> </span><span id="unitPprComponentName"><span class="annot"><span class="annottext">UnitPprInfo -&gt; Maybe String
</span><a href="GHC.Unit.Ppr.html#unitPprComponentName"><span class="hs-identifier hs-var hs-var">unitPprComponentName</span></a></span></span><span>  </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="../../base/src/GHC.Maybe.html#Maybe"><span class="hs-identifier hs-type">Maybe</span></a></span><span> </span><span class="annot"><a href="../../base/src/GHC.Base.html#String"><span class="hs-identifier hs-type">String</span></a></span><span> </span><span class="hs-comment">-- ^ Component name</span><span>
</span><span id="line-20"></span><span>   </span><span class="hs-special">}</span><span>
</span><span id="line-21"></span><span>
</span><span id="line-22"></span><span class="hs-keyword">instance</span><span> </span><span id="local-6989586621680828158"><span class="annot"><a href="GHC.Utils.Outputable.html#Outputable"><span class="hs-identifier hs-type">Outputable</span></a></span><span> </span><span class="annot"><a href="GHC.Unit.Ppr.html#UnitPprInfo"><span class="hs-identifier hs-type">UnitPprInfo</span></a></span></span><span> </span><span class="hs-keyword">where</span><span>
</span><span id="line-23"></span><span>  </span><span id="local-6989586621680828154"><span class="annot"><span class="annottext">ppr :: UnitPprInfo -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#ppr"><span class="hs-identifier hs-var hs-var hs-var hs-var">ppr</span></a></span></span><span> </span><span id="local-6989586621680828152"><span class="annot"><span class="annottext">UnitPprInfo
</span><a href="#local-6989586621680828152"><span class="hs-identifier hs-var">pprinfo</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">String -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#text"><span class="hs-identifier hs-var">text</span></a></span><span> </span><span class="annot"><span class="annottext">(String -&gt; SDoc) -&gt; String -&gt; SDoc
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="annot"><span class="annottext">[String] -&gt; String
forall a. Monoid a =&gt; [a] -&gt; a
</span><a href="../../base/src/GHC.Base.html#mconcat"><span class="hs-identifier hs-var">mconcat</span></a></span><span>
</span><span id="line-24"></span><span>      </span><span class="hs-special">[</span><span> </span><span class="annot"><span class="annottext">UnitPprInfo -&gt; String
</span><a href="GHC.Unit.Ppr.html#unitPprPackageName"><span class="hs-identifier hs-var hs-var">unitPprPackageName</span></a></span><span> </span><span class="annot"><span class="annottext">UnitPprInfo
</span><a href="#local-6989586621680828152"><span class="hs-identifier hs-var">pprinfo</span></a></span><span>
</span><span id="line-25"></span><span>      </span><span class="hs-special">,</span><span> </span><span class="hs-keyword">case</span><span> </span><span class="annot"><span class="annottext">UnitPprInfo -&gt; Version
</span><a href="GHC.Unit.Ppr.html#unitPprPackageVersion"><span class="hs-identifier hs-var hs-var">unitPprPackageVersion</span></a></span><span> </span><span class="annot"><span class="annottext">UnitPprInfo
</span><a href="#local-6989586621680828152"><span class="hs-identifier hs-var">pprinfo</span></a></span><span> </span><span class="hs-keyword">of</span><span>
</span><span id="line-26"></span><span>         </span><span class="annot"><a href="../../base/src/Data.Version.html#Version"><span class="hs-identifier hs-type">Version</span></a></span><span> </span><span class="hs-special">[</span><span class="hs-special">]</span><span> </span><span class="hs-special">[</span><span class="hs-special">]</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;&quot;</span></span><span>
</span><span id="line-27"></span><span>         </span><span id="local-6989586621680828149"><span class="annot"><span class="annottext">Version
</span><a href="#local-6989586621680828149"><span class="hs-identifier hs-var">version</span></a></span></span><span>       </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;-&quot;</span></span><span> </span><span class="annot"><span class="annottext">String -&gt; String -&gt; String
forall a. [a] -&gt; [a] -&gt; [a]
</span><a href="../../base/src/GHC.Base.html#%2B%2B"><span class="hs-operator hs-var">++</span></a></span><span> </span><span class="annot"><span class="annottext">Version -&gt; String
</span><a href="../../base/src/Data.Version.html#showVersion"><span class="hs-identifier hs-var">showVersion</span></a></span><span> </span><span class="annot"><span class="annottext">Version
</span><a href="#local-6989586621680828149"><span class="hs-identifier hs-var">version</span></a></span><span>
</span><span id="line-28"></span><span>      </span><span class="hs-special">,</span><span> </span><span class="hs-keyword">case</span><span> </span><span class="annot"><span class="annottext">UnitPprInfo -&gt; Maybe String
</span><a href="GHC.Unit.Ppr.html#unitPprComponentName"><span class="hs-identifier hs-var hs-var">unitPprComponentName</span></a></span><span> </span><span class="annot"><span class="annottext">UnitPprInfo
</span><a href="#local-6989586621680828152"><span class="hs-identifier hs-var">pprinfo</span></a></span><span> </span><span class="hs-keyword">of</span><span>
</span><span id="line-29"></span><span>         </span><span class="annot"><span class="annottext">Maybe String
</span><a href="../../base/src/GHC.Maybe.html#Nothing"><span class="hs-identifier hs-var">Nothing</span></a></span><span>    </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;&quot;</span></span><span>
</span><span id="line-30"></span><span>         </span><span class="annot"><a href="../../base/src/GHC.Maybe.html#Just"><span class="hs-identifier hs-type">Just</span></a></span><span> </span><span id="local-6989586621680828147"><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621680828147"><span class="hs-identifier hs-var">cname</span></a></span></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;:&quot;</span></span><span> </span><span class="annot"><span class="annottext">String -&gt; String -&gt; String
forall a. [a] -&gt; [a] -&gt; [a]
</span><a href="../../base/src/GHC.Base.html#%2B%2B"><span class="hs-operator hs-var">++</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621680828147"><span class="hs-identifier hs-var">cname</span></a></span><span>
</span><span id="line-31"></span><span>      </span><span class="hs-special">]</span><span>
</span><span id="line-32"></span></pre></body></html>